﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemySpawn : MonoBehaviour {

    public Transform m_enemyProductor;
    // Use this for initialization
	void Start () {

        StartCoroutine(makeEnemy());
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}

    private void OnDrawGizmos()
    {
        Gizmos.DrawIcon(transform.position,"item.png",true);
    }

    IEnumerator makeEnemy()
    {
        while (true)
        {
            yield return new WaitForSeconds(Random.Range(5, 15));
            Instantiate(m_enemyProductor, transform.position, Quaternion.identity);
        }
    }

}
